import request from '@/utils/request';

// 获取数据面板信息
export const getDataPanel = (params) => {
  return request({
    url: '/data/panel',
    method: 'get',
    params
  });
};

// 获取数据面板用户信息
export const getDataPanelUser = (params) => {
  return request({
    url: '/data/panel/user',
    method: 'get',
    params
  });
};

// 导出用户数据
export const exportUserData = (params) => {
  return request({
    url: '/data/panel/user/export',
    method: 'get',
    params,
    responseType: 'blob',
    timeout: 600000 // 10分钟超时
  });
};

// 导出文章数据
export const exportArticleData = (params) => {
  return request({
    url: '/data/panel/article/export',
    method: 'get',
    params,
    responseType: 'blob',
    timeout: 600000 // 10分钟超时
  });
};

// 导出反馈数据
export const exportFeedbackData = () => {
  return request({
    url: '/data/panel/feedback/export',
    method: 'get',
    responseType: 'blob',
    timeout: 600000 // 10分钟超时
  });
};

// 导出积分数据
export const exportPointsData = () => {
  return request({
    url: '/data/panel/points/export',
    method: 'get',
    responseType: 'blob',
    timeout: 600000 // 10分钟超时
  });
};

// 导出文章日志数据
export const exportArticleLogData = () => {
  return request({
    url: '/data/panel/article/log/export',
    method: 'get',
    responseType: 'blob',
    timeout: 600000 // 10分钟超时
  });
};

// 导出文章评分日志数据
export const exportArticleReviewLogData = () => {
  return request({
    url: '/data/panel/article/review/log/export',
    method: 'get',
    responseType: 'blob',
    timeout: 600000 // 10分钟超时
  });
};

// 导出文章相关统计数据
export const exportArticleCountData = () => {
  return request({
    url: '/data/panel/article/count/export',
    method: 'get',
    responseType: 'blob',
    timeout: 600000 // 10分钟超时
  });
};